package com.dhsc.service.impl.wskh;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dhsc.domain.ywzx.wskh.TWskhKhxxVo;
import com.dhsc.domain.yypt.LayuiTableVo;
import com.dhsc.exception.MyException;
import com.dhsc.local.dao.wskh.ITWskhKhxxDao;
import com.dhsc.service.wskh.ITWskhKhxxService;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class TWskhKhxxServiceImpl implements ITWskhKhxxService{
	
	@Autowired
	private ITWskhKhxxDao twskhkhxxDao;

	@Override
	public LayuiTableVo queryTWskhKhxxByAll(TWskhKhxxVo y) {
		LayuiTableVo obj = new LayuiTableVo();
		try{
			PageMethod.startPage(y.getPage(),y.getLimit());
			List<TWskhKhxxVo> list = twskhkhxxDao.queryTWskhKhxxByAll(y);
			PageInfo<TWskhKhxxVo> pageInfo = new PageInfo<>(list);
			obj.setData(list);
			obj.setMsg("");
			obj.setCount(pageInfo.getTotal());
			obj.setCode(0);
		}catch(Exception e){
			log.error("查询网上开户客户信息出错", e);
			throw new MyException("查询网上开户客户信息出错",e);
		}
		return obj;
	}
}